package de.tudarmstadt.ukp.muip.fibqdojo.visitor;

import de.tudarmstadt.ukp.muip.fibqdojo.Sentence;
import de.tudarmstadt.ukp.muip.fibqdojo.SentenceToken;
import de.tudarmstadt.ukp.muip.fibqdojo.Token;
import de.tudarmstadt.ukp.muip.fibqdojo.interfaces.IStructureVisitor;
import de.tudarmstadt.ukp.muip.fibqdojo.japanese.JapaneseToken;

public class GetPartOfSpeechVisitor implements IStructureVisitor{
        
        private String partOfSpeech = "";
        public String getPartOfSpeech() {
            return partOfSpeech;
        }
        
        @Override
        public void visit(JapaneseToken token) {
            String pos = token.getPartOfSpeech()[0];
            partOfSpeech = pos;
        }

        @Override
        public void visit(Token token) {
            partOfSpeech = token.getPartOfSpeech();
        }

        @Override
        public void visit(SentenceToken token) {
            token.getToken().accept(this);
        }

        @Override
        public void visit(Sentence sentence) {
        }

}
